<?php
namespace app\index\controller;
use think\Controller;
use think\Request;
class  Base extends  Controller{

    //构造器
    public function _initialize(){
        $request    = Request::instance();//获取请求类型
        $controller = $request->controller();//获取控制器
        $user       = session('lt_user');
        //判断是否需要登录的控制器
        if($controller == 'Request'){
            $user    = session('lt_user');
            if(empty($user)){
                exit($this->error('请先登录，在进行操作！'));
                /*exit($this->redirect('Login/login'));*/
            }
        }
        $this->assign('data_user',$user);
        $this->assign('index_css',1);
        $this->assign('sie',pageSie(9));//页面描述与关键字
    }

}
